package com.mes.common.usermanagement;

/**
 * <p>Title: MES</p>
 *
 * <p>Description: ����ִ��ϵͳ</p>
 *
 * <p>Copyright: Copyright (c) 2004</p>
 *
 * <p>Company: BUAA 720</p>
 *
 * @author afu
 * @version 1.0
 */
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Properties;
@Deprecated
public class MMProperty {
  public MMProperty() {
  }

  String mm_home = MMPath.getMMHome();
  String mmFile = mm_home + "mm.properties";
  /**
   * �ú����Ѿ���MMUTils.getProperty����ȡ��
   * ��Ҫԭ���Ǹú���ÿ�ζ�Ҫȥ��ȡ�ļ���Ч��̫��
   * @param name
   * @return
   */
  @Deprecated
  public String getProperty(String name) {
    String property = null;

    Properties p = new Properties();
    FileInputStream fis;
    try {
      fis = new FileInputStream(mmFile);
      p.load(fis);
      property = p.getProperty(name);

    }
    catch (FileNotFoundException e) {
      e.printStackTrace();
    }
    catch (IOException e1) {
      e1.printStackTrace();
    }
    return property;
  }
  @Deprecated
  public void setProperty(String name, String value) {

    Properties p = new Properties();
    FileInputStream fis;
    FileOutputStream fos;
    PrintWriter pw;
    try {
      fis = new FileInputStream(mmFile);
      fos = new FileOutputStream(mmFile);
      p.load(fis);
      /*if (this.getProperty(name) == null) {
        fos.write( (name + "=" + value).getBytes());
             }
             else {*/
      p.setProperty(name, value);
      //}
    }
    catch (FileNotFoundException e) {
      e.printStackTrace();
    }
    catch (IOException e1) {
      e1.printStackTrace();
    }
  }

}
